package com.txsj.scan.widget;

import android.graphics.Color;
import android.view.View;
import android.widget.TextView;

import com.androidadvance.topsnackbar.TSnackbar;
import com.txsj.scan.R;


/**
 * Created by wwb on 2017/3/10.
 */
public class TSnackbarView {

    public TSnackbarView(View view, String msg) {
        if (view == null) {
            return;
        }
        TSnackbar snackbar;
        snackbar = TSnackbar
                .make(view, msg, TSnackbar.LENGTH_LONG);

        snackbar.setActionTextColor(Color.BLACK);
        snackbar.setIconLeft(R.mipmap.icon_error_info, 25);
        snackbar.setIconPadding(10);
        View snackbarView = snackbar.getView();
        snackbarView.setBackgroundColor(Color.parseColor("#F7F7F7"));
        TextView textView = (TextView) snackbarView.findViewById(com.androidadvance.topsnackbar.R.id.snackbar_text);
        textView.setTextSize(14);
        textView.setTextColor(Color.parseColor("#000000"));
        snackbar.show();
    }
}
